home *** CD-ROM | disk | FTP | other *** search
- |##########|
- |#MAGIC #|BOPDOMKJ
- |#PROJECT #|"FunctionPlotter"
- |#PATHS #|"EGSProject"
- |#FLAGS #|-x---x-xxx----x-----------------
- |#USERSW #|--------------------------------
- |#USERMASK#|--------------------------------
- |#SWITCHES#|xx---xxxxx-xx---
- |##########|
- MODULE FunctionPlotterPart;
-
- FROM EGSIntui AS I IMPORT WindowGrp,MenuGrp,MessageGrp;
- FROM EGSGadBox AS GB IMPORT GadBoxPtr,GadContext;
- FROM EGSGfx AS G IMPORT EFontPtr;
- FROM Dos IMPORT Delay;
- FROM EGS IMPORT CLUEntry,BitMapGrp;
- FROM Intuition IMPORT okCancel;
-
- IMPORT GBMenuSelect AS GM;
- IMPORT GBRadio AS GR;
- IMPORT GBScrollBox AS GS;
- IMPORT GBColorPot AS GC;
-
-
- CONST
- GID_FuncStr = $10000;
- GID_MinX = $20000; GID_MaxX = $20001;
- GID_MinY = $20002; GID_MaxY = $20003;
- GID_MinZ = $20004; GID_MaxZ = $20005;
- GID_Resolution = $30000;
- GID_FuncColor = $40000;
- GID_BackColor = $40001;
- GID_Light = $50000;
- GID_StdFuncs = $60000;
- GID_DrawMode = $70000;
- GID_OutLines = $80000;
- GID_Mirror = $80001; GID_Specular = $80002;
- GID_Shadows = $80003;
- GID_Pitch = $A0000; GID_Bearing = $A0001;
- GID_Render = $B0000; GID_Stop = $B0001;
-
- EXCEPTION
- NoGadSolution : "Could not create gadgets";
-
- VAR
- Win : WindowPtr;
- DrawArea : GB.ResBox;
- GCon : GadContext;
- WFont : EFontPtr;
-
-
- PROCEDURE CreateGadgets;
-
- VAR
- root : GadBoxPtr;
-
-
- PROCEDURE CreatePictureBox():GadBoxPtr;
- BEGIN
- RETURN GB.CreateGroupBorder(GCon, | erzeugt Umrandung mit Titel
- GB.CreateVertiTableL(GCon,
- GB.CreateHorizBoxL(GCon,
- GB.CreateBackBorder(GCon, | Erzeugt den Rahmen
- | um die Zeichenfläche
- | Erzeugt die Zeichenfläche
- GB.CreateResponseBox(GCon,DrawArea,200,
- GB.max,100,GB.max),{}),
- GB.CreateHorizFill(GCon,FALSE,0),
- | Erzeugt vertikale Proportionalgadget mit Pfeilgadgets
- GB.NewPri(GB.CreateSuperVertiProp(GCon,95,5,0,
- GID_Pitch,
- {GB.aDecBR,
- GB.aIncBR}),-1)
- ),
- GB.CreateVertiFill(GCon,FALSE,0),
- GB.NewPri(
- GB.CreateHorizBoxL(GCon,
- GB.CreateSuperHorizProp(GCon,185,5,90,GID_Bearing,
- {GB.aDecBR,GB.aIncBR}),
- GB.CreateHorizFill(GCon,FALSE,0),
- GB.CreateFillBox(GCon,-1)
- ),-1
- )
- ),{}," Picture "
- );
- END CreatePictureBox;
-
- PROCEDURE CreateAction():GadBoxPtr;
- BEGIN
- RETURN GB.CreateVertiBoxL(GCon,
- GB.CreateTextAction(GCon,"_Render",GID_Render,{}),
- GB.CreateVertiFill(GCon,FALSE,0),
- GB.CreateTextAction(GCon,"_Stop",GID_Stop,{})
- );
- END CreateAction;
-
- BEGIN
- GCon:=GB.CreateGadContext(NIL,NIL,-1,-1);
- root:=GB.CreateMasterWindow(GCon,Win,
- GB.CreateVertiBoxL(GCon,
- GB.NewPri(
- GB.CreateHorizBoxL(GCon,
-
- GB.NewPri(CreatePictureBox(),1)
-
- ),1
- ),
- GB.CreateVertiFill(GCon,FALSE,0),
- GB.CreateNameStringGadget(GCon,"f(x,y)",40,200,
- I.justifyLeft,GID_FuncStr),
- GB.CreateVertiFill(GCon,FALSE,0),
- GB.CreateHorizBoxL(GCon,
- GS.CreateLateScrollBox(GCon,40,200,4,8,FALSE,GID_StdFuncs),
- GB.CreateHorizFill(GCon,FALSE,0),
-
- CreateAction()
-
- )
- )
- );
- ASSERT(GB.ProcessGadBoxes(GCon,root),NoGadSolution);
- END CreateGadgets;
-
-
- VAR
- Msg : EIntuiMsgPtr;
- done : BOOLEAN;
- tmpRas : EBitMapPtr;
-
- BEGIN
- CreateGadgets;
- WITH GCon.newWin AS w DO
- UNI(w.flags,WindowFlagSet:{WindowSizeBottom,WindowActive});
- UNI(w.sysGadgets,SysGadgetSet:{windowClose,windowSize,windowFlip});
- UNI(w.idcmpFlags,EIDCMPFlagSet:{iWindowClose,iGadget,iMenu,iWindowSize,
- iDrop,iSizeVerify});
- w.name:="Functionplotter";
- END;
- Win:=OpenWindow(GCon.newWin^);
- IF Win#NIL THEN
- REPEAT
- FORGET WaitPort(Win.port);
- Msg:= GetMsg(Win.port);
- WHILE Msg # NIL DO
- IF KEY Msg.class
- OF {iWindowClose} THEN
- done:=TRUE
- END;
- END;
- ReplyMsg(Msg);
- Msg:=GetMsg(Win.port);
- END
- UNTIL done;
- END;
- CLOSE
- IF Win # NIL THEN
- CloseWindow(Win);
- Win:=NIL;
- END;
- IF GCon # NIL THEN
- GB.DeleteGadContext(GCon);
- GCon:=NIL;
- END;
- END FunctionPlotterPart.
-